home *** CD-ROM | disk | FTP | other *** search
- --------------------------------------------------------------------------------
- -- Weapon Parachute
- -- Original Carnage Contest Weapon
- -- Script by DC, August 2009, www.UnrealSoftware.de
- --------------------------------------------------------------------------------
-
- -- Setup Tables
- if cc==nil then cc={} end
- cc.parachute={}
-
- -- Load & Prepare Ressources
- cc.parachute.gfx_wpn=loadgfx("weapons/parachute.bmp") -- Weapon Image
- setmidhandle(cc.parachute.gfx_wpn)
- --cc.parachute.sfx_wpn=loadsfx("parachute.wav") -- parachute Sound
-
- --------------------------------------------------------------------------------
- -- Weapon: Parachute
- --------------------------------------------------------------------------------
-
- cc.parachute.id=addweapon("cc.parachute","Parachute",cc.parachute.gfx_wpn,1) -- Add Weapon (1 use)
-
- function cc.parachute.draw() -- Draw
- if weapon_mode==1 then
- setblend(blend_alpha)
- setalpha(0.9)
- setcolor(255,255,255)
- setscale(getplayerdirection(0),1)
- setrotation(0)
- drawimage(cc.parachute.gfx_wpn,getplayerx(0),getplayery(0)-8)
- -- HUD Info
- hudinfo("Press [Space] to deactivate the parachute!")
- elseif weapon_shots==0 then
- -- HUD Info
- hudinfo("Parachute will be activated automatically when falling!")
- end
- end
-
- function cc.parachute.attack(attack) -- Attack
- if (weapon_mode==0) and (weapon_shots==0) then
- if getplayeryspeed(0)>7.0 then
- -- Use weapon and allow to use another one afterwards (1)
- useweapon(1)
- -- Activate
- weapon_mode=1
- weapon_shots=1
- end
- end
- -- Control fallspeed if parachute is active
- if (weapon_mode==1) then
- -- Disable parachute
- if attack==1 or getplayeryspeed(0)<1.0 then
- weapon_mode=0
- end
- if getframesleft()<=1 then
- weapon_mode=0
- end
- -- Control fallspeed
- playerpush(0,getwind()*10.0,1.0,1)
- end
- end